﻿using Abp.Domain.Entities.Auditing;
using FwProject.Authorization.Users;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace FwProject.ShoppingMall.Com
{
    /// <summary>
    /// 收货地址
    /// </summary>
    [Table("shop_receiving_address")]
    public class ShopReceivingAddress : FullAuditedEntity<Guid>
    {
        public const int MaxReceivingNameLength = 50;
        public const int MaxReceivingTelLength = 13;
        public const int MaxReceivingAddressLength = 200;
        /// <summary>
        /// 用户Id
        /// </summary>
        public long UserId { get; set; }

        /// <summary>
        /// 购买人名称
        /// </summary>
        [Required]
        [StringLength(MaxReceivingNameLength)]
        public string ReceivingName { get; set; }

        /// <summary>
        /// 收货电话
        /// </summary>
        [Required]
        [StringLength(MaxReceivingTelLength)]
        public string ReceivingTel { get; set; }

        /// <summary>
        /// 收货地址
        /// </summary>
        [Required]
        [StringLength(MaxReceivingAddressLength)]
        public string ReceivingAddress { get; set; }
        /// <summary>
        /// 默认收货地址
        /// </summary>
        [Required]
        public bool DefalutAddress { get; set; } = true;

        /// <summary>
        /// 所属区域
        /// </summary>
        public string AreaId { get; set; }
        /// <summary>
        /// 所属行政区域地址
        /// </summary>
        public string AreaAddress { get; set; }
    }
}
